do_something(a,b) /* This function does something with a and b*/ { int ret; char arg1[10]; char arg2[10]; /* Turn the arguments to strings */ sprintf(arg1,"%d",a); sprintf(arg2,"%d",b); /* Execute the program */ if (fork() == 0) execlp("domain","domain",arg1,arg2); /* Wait till it is finished and get the return code */ wait(&ret); /* Shift it over, as the return code is in the high order bits */ ret >> 8 && 0xFF; return ret; }